package fr.cdj.thebox.client.events;

import com.google.gwt.event.shared.GwtEvent;

public class ListFilesRequestEvent extends GwtEvent<ListFilesRequestHandler> {

	private static Type<ListFilesRequestHandler> type;

	private Object eventSource;
	
	private String path;
	
	public ListFilesRequestEvent(Object eventSource, String path) {
		this.eventSource = eventSource;
		this.path = path;
	}
	
	public static Type<ListFilesRequestHandler> getType() {
		if(type == null) {
			type = new Type<ListFilesRequestHandler>();
		}
		return type;
	}
	
	@Override
	public Type<ListFilesRequestHandler> getAssociatedType() {
		return getType();
	}

	@Override
	protected void dispatch(ListFilesRequestHandler handler) {
		handler.onListFilesRequest(this);
	}
	
	public Object getEventSource() {
		return eventSource;
	}

	public String getPath() {
		return path;
	}
	
}
